home *** CD-ROM | disk | FTP | other *** search
- Path: info.spt.net.cn!usenet
- From: Xu Yifeng <jafd@public.sta.net.cn>
- Newsgroups: comp.lang.c++
- Subject: Re: [Q] same template name with template-arg-list
- Date: Mon, 15 Jan 1996 10:44:15 -0800
- Organization: ZheJiang Securities Co.Ltd
- Message-ID: <30FAA07F.5396@public.sta.net.cn>
- References: <whlong48ht.fsf@balder.metis.no>
- NNTP-Posting-Host: ts1-20.sta.net.cn
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b5 (Win16; I)
-
- Steinar Bang wrote:
- |>
- |> Is it legal in the ANSI C++ draft to have something like:
- |>
- |> template<class T> class sequence {
- |> public:
- |> sequence() ;
- |> };
- |>
- |> template<class T, int len> class sequence {
- |> public:
- |> sequence() ;
- |> };
- |>
- |> and have these two be different templates?
- |>
- |> Same template name but different argument lists should give different
- |> signatures, so I don't see any principal problem...?
- |>
- |> Thanx!
- |>
- |> - Steinar
-
-
- Hi,
-
- I think you want to write two different templates,, it can not be compiled
- because naming conclusion, this because the signature in argument list
- is implied and not belong to the C++ naming space, the signatures will
- not be put into the class name, C++ doesn't support class overload!
-
- Best wishs,
- Xu Yifeng
-